package com.nstar.orderexpress.business
{
	import mx.rpc.IResponder;
	import com.adobe.cairngorm.business.ServiceLocator;
	import mx.rpc.AsyncToken;
	import com.nstar.orderexpress.vo.Menu2RestVO;
	import com.nstar.orderexpress.model.Model;
	import com.nstar.orderexpress.vo.PaginatorVO;
	import com.nstar.orderexpress.vo.OrderInfoVO;
	import com.nstar.orderexpress.vo.RequestVO;
	import com.nstar.base.util.Logger;
	import mx.utils.ObjectUtil;
	import mx.rpc.AbstractService;
	
	public class OrderExpressDelegate
	{
		private var responder:IResponder;
		private var service:AbstractService;
		
		private var model:Model = Model.getInstance();
		private var logger:Logger = Logger.getInstance();
				
		public function OrderExpressDelegate( responder : IResponder )
		{
			this.service = ServiceLocator.getInstance().getService( "orderExpressServices" );
			this.responder = responder;
		}
		
		//测试数据库
		public function pingSQL(sqltext:String):void{
			var request:Object = new Object();
			request.sqltext = sqltext;
			var call : AsyncToken = service.pingSQL(request);
			call.addResponder(responder);//添加异步返回处理
		}

		//查询菜单
		public function findMenus(request:RequestVO):void{
			var call : AsyncToken = service.findMenus(request);
			call.addResponder(responder);//添加异步返回处理
		}
		
		//购买
		public function insertOrderInfo(request:RequestVO):void{
			logger.debug("insertOrderInfo request="+ObjectUtil.toString(request));
			var call : AsyncToken = service.insertOrderInfo(request);
			call.addResponder(responder);//添加异步返回处理
		}
		
				
	}
}